<?php

/* 
 * 任务模型
 * @author wyb
 */
namespace Qwadmin\Model;

class TaskthreadModel extends \thread  {
    
	public $_model='TaskthreadModel';
    public $_method='__construct';
    public $_args='';
	public $_runed=0;
	
	function __construct($hash) {
      ///
	    $task=M('taskrun')->where("hash='".$hash."'")->find();
		$this->_model=$task['model'];
		$this->_method=$task['method'];
		$this->_args=$task['args'];
		$this->_runed=$task['runed'];
    } 
  
    public function run()
	{
	  if($this->_runed!=0)return array('rsp'=>'err');
	  $obj=new $this->_model();
	  return $obj->$this->_method($args);
		
	}
   /**
     * 自动生成key
     */
    private function __authKey() {
    
    
    }
}

